//
//  GSYDemoViewController.swift
//  GSY-微博-swift
//
//  Created by Song on 2017/11/27.
//  Copyright © 2017年 Song. All rights reserved.
//

import UIKit

class GSYDemoViewController: GSYBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        // 设置标题
        title = "第 \(navigationController?.childViewControllers.count ?? 0) 个";
    }
    
    @objc fileprivate func showNext() {
        
        let demoVc = GSYDemoViewController()
        navigationController?.pushViewController(demoVc, animated: true)
        
    }

}

extension GSYDemoViewController {
    
    // 重写父类方法
    override func setupTableView() { // 用户已经登录了
        super.setupTableView();
        // 设置右侧控制器 - 已抽取
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个啊", fontSize: 16, target: self, action: #selector(showNext))
    }
    
    
//    override func setupUI() {
//        
//        super.setupUI()
//        
//        // 设置右侧控制器
////        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext))
//        
//        // 设置右侧控制器 - 已抽取
//        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个啊", fontSize: 16, target: self, action: #selector(showNext))
//    }
}
